﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.CMS263.PO;

namespace Com.CMS263.DAO
{
    public class RegionDAO : BaseService
    {
        public IList<Region> GetListPaging(int fatherid,int isbest)
        {
            string hql = "from Region where 1=1";
            if (isbest == -1)
            {
                if (fatherid != -1)
                {
                    hql += " and Father = " + fatherid;
                }
                
            }
            else
            {
                hql += " and IsBest=" + isbest;
                if (fatherid != -1)
                {
                    hql += " and Father = " + fatherid;
                }
            }
            hql += " order By Regionorder asc";
            return FindList<Region>(hql,null,null,null);
        }
    }
}
